//引入api
import {
    requestCategoryList
}from "@/api"

//home模块的配置
const state = {
    cateGoryList: []
}
const mutations = {
    //修改gateGoryList的函数
    SET_GATEGORYLIST_STATE(state , value){
        state.cateGoryList = value
    }
}
const actions = {
    //1.请求三级列表
    async getCateGoryList({commit}){
        //发送请求
        const result = await requestCategoryList("/api/product/getBaseCategoryList")
        //提交到mutations中
        commit("SET_GATEGORYLIST_STATE" , result)
    }
}

const getters = {}

export default {
    //开启命名空间
    namespaced: true,
    state,
    mutations,
    actions,
    getters,
}
